Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.error
Class FileRange

    java.lang.Object
      rdlc.error.FileRange

All Implemented Interfaces:
  ErrorLocation

    public class FileRange

extends java.lang.Object
implements ErrorLocation

Record a range of positions in a file. Stores the start and end, line and column as well as the name of the file. Used extensively for recording and reporting errors by the position of the error in the source file.

Version:
  $Revision: 1.4 $
Author:
  Greg Gibeling

Field Summary
`protected int` | `endcol` The column within the end line where this range ends.
`protected int` | `endline` The line on which this range ends
`protected java.lang.String` | `fileName` The name of the file which contains this range.
`protected int` | `startcol` The column within the start line where this range starts.
`protected int` | `startline` The line on which this range starts.

Constructor Summary
`FileRange(FilePosition _start, FilePosition _end)` Base constructor, decodes the start and end line and columns from a pair of @link FilePosition} objects.
`FileRange(FileRange other)` Copy constructor.
`FileRange(int _startline, int _startcol, int _endline, int _endcol, java.lang.String _fileName)` Base constructor, creates a `FileRange` from its constituent components.
`FileRange(int _start, int _end, java.lang.String _fileName)` Base constructor, decodes the start and end line/cols from encoded int representations.

Method Summary
`boolean` | `contains(FilePosition pos)` Determine if this range contains the given position.
`boolean` | `contains(int line, int col)` Determine if this range contains the given position.
`boolean` | `equals(FileRange other)` Check if the `other` `FileRange` indicates the same range in the same file as this one.
`int` | `hashCode()` Simple accessor.
`java.lang.String` | `locationName()` Simple accessor.
`void` | `merge(FilePosition pos)` Extend this range in the correct direction so that it includes the given position.
`void` | `merge(FileRange range)` Marge the given range into this one.
`void` | `merge(int start, int end)` Marge the given encoded range into this range.
`java.lang.String` | `toString()` Creates a standard human readable version of this object.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### startline

    protected int startline

  The line on which this range starts.

### endline

    protected int endline

  The line on which this range ends

### startcol

    protected int startcol

  The column within the start line where this range starts.

### endcol

    protected int endcol

  The column within the end line where this range ends.

### fileName

    protected java.lang.String fileName

  The name of the file which contains this range.

Constructor Detail

### FileRange

    public FileRange(int _startline,
                     int _startcol,
                     int _endline,
                     int _endcol,
                     java.lang.String _fileName)

  Base constructor, creates a `FileRange` from its constituent components.

  Parameters:
    `_startline` - The line on which this range starts.
    `_startcol` - The column within the start line where this range starts.
    `_endline` - The line on which this range ends
    `_endcol` - The column within the end line where this range ends.
    `_fileName` - The name of the file which contains this range.

### FileRange

    public FileRange(int _start,
                     int _end,
                     java.lang.String _fileName)

  Base constructor, decodes the start and end line/cols from encoded int representations.

  Parameters:
    `_start` - Encoded start line and column
    `_end` - Encoded start line and column
    `_fileName` - The name of the file which contains this range.
  See Also:
    `FilePosition.encode(int, int)`, `FilePosition.decodeCol(int)`, `FilePosition.decodeLine(int)`

### FileRange

    public FileRange(FilePosition _start,
                     FilePosition _end)

  Base constructor, decodes the start and end line and columns from a pair of @link FilePosition} objects. If the file names don't match then this range will include all of the start file.

  Parameters:
    `_start` - Start `FilePosition`
    `_end` - End `FilePosition`

### FileRange

    public FileRange(FileRange other)

  Copy constructor.

  Parameters:
    `other` - The `FileRange` to copy.

Method Detail

### toString

    public java.lang.String toString()

  Creates a standard human readable version of this object. This is used primarily during error reporting.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    Standard human readable file range.
  See Also:
    `Error.toString()`, `ErrorLocation.locationName()`

### hashCode

    public int hashCode()

  Simple accessor.

  Overrides:
    `hashCode` in class `java.lang.Object`
  Returns:
    A simple hash code from this file range.
  See Also:
    `Object.hashCode()`

### equals

    public boolean equals(FileRange other)

  Check if the `other` `FileRange` indicates the same range in the same file as this one. Note that this is a check for strict equality, not for overlap.

  Parameters:
    `other` - The other file position to check.
  Returns:
    `true` if these two FilePositions indicate the same position in the same file.

### contains

    public boolean contains(FilePosition pos)

  Determine if this range contains the given position. This checks not only the line and column but also the file name.

  Parameters:
    `pos` - The `FilePosition` to check
  Returns:
    `true` if this range contains the given position.

### contains

    public boolean contains(int line,
                            int col)

  Determine if this range contains the given position. Of course this function does not check that the position is in the correct file.

  Parameters:
    `line` - The line to check.
    `col` - The column to check.
  Returns:
    `true` if this range contains the given position.

### merge

    public void merge(FilePosition pos)

  Extend this range in the correct direction so that it includes the given position.

  Parameters:
    `pos` - The position to merge into this range

### merge

    public void merge(int start,
                      int end)

  Marge the given encoded range into this range. This is heavily used when parsing indentifiers, so that we can store the complete file range of the identifier.

  Parameters:
    `start` - The encoded start line and column.
    `end` - The encoded end line and column.
  See Also:
    `FilePosition.encode(int, int)`

### merge

    public void merge(FileRange range)

  Marge the given range into this one. Note that if the given range is not in the right file, the merge is aborted.

  Parameters:
    `range` - The range to merge into this one.

### locationName

    public java.lang.String locationName()

  Simple accessor.

  Specified by:
    `locationName` in interface `ErrorLocation`
  Returns:
    A human readable representation of this file position.
  See Also:
    `toString()`, `ErrorLocation.locationName()`, `Error.toString()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD